const router = require('koa-router')()
const userController = require('../controllers/user')
const errorhandle = require('../middlewares/error')

router.prefix('/users')

router.all('/*', async (ctx, next) => {
    if(!ctx.isAuthenticated()) {
        ctx.status = 401
    }
    await next()
 })

router.get('/userlist', userController.userlist)
router.use(errorhandle)




module.exports = router
